package com.xnyzc.lhy.finance.service.impl.invoice;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xnyzc.lhy.finance.entity.invoice.OaSysInvoiceDetail;
import com.xnyzc.lhy.finance.mapper.invoice.OaSysInvoiceDetailMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xnyzc.lhy.finance.service.invoice.IOaSysInvoiceDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 客户发票明细表 服务实现类
 * </p>
 *
 * @author haoyfa
 * @since 2019-10-24
 */
@Service
public class OaSysInvoiceDetailServiceImpl extends ServiceImpl<OaSysInvoiceDetailMapper, OaSysInvoiceDetail> implements IOaSysInvoiceDetailService {
    @Autowired
    OaSysInvoiceDetailMapper oaSysInvoiceDetailMapper;

    /**
     * 根据信息id获取发票信息
     * */
    @Override
    public OaSysInvoiceDetail selectOaSysInvoiceDetailByInfoId(Long infoId) {
        try {
            //获取审核状态字典
            QueryWrapper queryWrapper=new QueryWrapper();

            queryWrapper.eq(OaSysInvoiceDetail.INVOICE_INFO_ID, infoId);
            OaSysInvoiceDetail oaSysInvoiceDetail = oaSysInvoiceDetailMapper.selectOne(queryWrapper);
            return oaSysInvoiceDetail;
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
        }
    }
}
